package ua.kpi_java_training.tyshchenko.module2.test;

import static junit.framework.Assert.*;
import org.junit.Before;
import org.junit.Test;
import ua.kpi_java_training.tyshchenko.module2.*;

/**
 * @author Vlad Tyshchenko
 * @version 1.0 5 June 2013
 */
public class VictimTest {
    Victim vic;

    @Before
    public void setUp() {
        vic = new Victim(new Habitat(new StabInputAllData()));
    }

    @Test
    public void testCheckBirth() {
        assertFalse(vic.checkBirth());
        for (int i = 0; i < 3; i++) {
            vic.move();
        }
        assertTrue("add new victim ", vic.checkBirth());
    }

    @Test
    public void testGetNewFish() {
        assertTrue("check type new victim ", vic.getNewFish() instanceof CreatureInHabitat);
        assertTrue("check type new victim ", vic.getNewFish() instanceof Victim);
        assertFalse("check type new victim ", vic.getNewFish() instanceof Predator);
    }
}
